package day0401;

import java.util.Scanner;

public class ReverseWord11 {
    /**
     * 11 .按单词下标区间翻转文章内容
     * 例如给定的英文文章片段为"I am a developer"，翻转区间为[0,3]，则输出"developer a am I"
     * <p>
     * 输入：
     * I am a developer
     * 1
     * 2
     * 输出：
     * I a am developer
     * <p>
     * 输入：
     * I am a developer
     * 0
     * 5
     * 输出：
     * developer a am I
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split(" ");
        int start = Integer.parseInt(sc.nextLine());
        int end = Integer.parseInt(sc.nextLine());
        start = Math.max(start, 0);
        end = Math.max(end, 0);
        end = Math.min(end, s.length - 1);
        while (start < end) {
            String temp = s[start];
            s[start] = s[end];
            s[end] = temp;
            start++;
            end--;
        }
        StringBuilder res = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            res.append(s[i]).append(" ");
        }
        System.out.println(res.substring(0, res.length() - 1));
    }
}
